<?php
require_once('../../conf/config.php.inc');
require_once(SYBMAS_LIB_PATH.'/liblogin.php.inc');
require_once(SYBMAS_LAYOUT_PATH.'/layout.php.inc');
require_once(SYBMAS_LIB_PATH.'/libsybase.php.inc');
require_once(SYBMAS_LIB_PATH.'/libsybmas.php.inc');
require_once(SYBMAS_LAYOUT_PATH.'/menu.php.inc');
verificar_inicio_sesion();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css"
	href="<?php echo LAYOUT_URI?>/sybmasstyle.css">
<script src="<?php echo LAYOUT_URI?>/jquery-1.2.1.min.js"
	type="text/javascript"></script>
<script src="<?php echo LAYOUT_URI?>/menu-collapsed.js"
	type="text/javascript"></script>
<link rel="stylesheet" type="text/css"
	href="<?php echo LAYOUT_URI?>/style.css" >
<link rel="stylesheet" type="text/css"
	href="<?php echo JAVASCRIPT_URI?>/tabs/tabs.css">
<script src="<?php echo JAVASCRIPT_URI?>/tabs/tabs.js"
	type="text/javascript"></script>
<script src="usuarios.js"
	type="text/javascript"></script>
<script src="<?php echo JAVASCRIPT_URI?>/validacionFormularios.js"
	type="text/javascript"></script>
	
<script type="text/javascript" src="usuarios.js"></script>
	
<title>.:: Sybmas - Alta de Login</title>
<!--[if lt IE 8]>
   <style type="text/css">
   li a {display:inline-block;}
   li a {display:block;}
   </style>
   <![endif]-->
</head>
<body>
<script src="<?php echo JAVASCRIPT_URI?>/tooltip/wz_tooltip.js"
	type="text/javascript"></script>
<center>
<div id="container">
<div id="header"><?php generar_header();?></div>
<div id="scene">
<div id="modulos">
<ul id="menu" style="width: 150px;">
   <?php echo generar_menu();?>
</ul>
</div>

<div id="title">Alta de Logins</div>
<div id="main">

<form method="POST" id="formAltaLogin" action="libaltaLogin.php" onsubmit="return validarFormAltaLogin()">
<table>
	<tr>
		<td><span onmouseover="Tip('Nombre del Login a Crear')" onmouseout="UnTip()">Nombre de Login</span></td>
		<td><input type="text" name="sybmas_loginname" id="sybmas_loginname" maxlength="30"
			onkeypress="return onKeyPressPermiteAlfaNumericosNoEspacios(event)"></td>
	</tr>
	<tr>
	    <td><span onmouseover="Tip('Password del Login a Crear')" onmouseout="UnTip()">Password</span></td>		
		<td><input type="password" name="sybmas_password" id="sybmas_password" maxlength="30"></td>
	</tr>
	<tr>
		<td><span onmouseover="Tip('Base de Datos a la que accesara el Login')" onmouseout="UnTip()">Base de datos</span></td>
		<td><?php $sybmas_connection=start_sybmas_connection();		    
		    combo();
		    ?>
		</td>
       <?php 		
		  function combo(){	
		  	$query="SELECT name FROM master..sysdatabases";		
			echo "<select name='bd' id='bd'>";
			$resultado=sybase_query($query);
			while ($fila=sybase_fetch_row($resultado)){				
					echo"<option value='$fila[0]'>$fila[0]";
				}				
			}
			echo "</select>";				
		?>		
	</tr>
	<tr>
		<td><span onmouseover="Tip('Lenguaje')" onmouseout="UnTip()">Lenguaje</span></td>
		<td>
		<?php 
			$query="SELECT name FROM master..syslanguages";		
			echo "<select name='sybmas_language' id='sybmas_language'>";
			echo"<option value='us_english'>US English";
			$resultado=sybase_query($query);
			while ($fila=sybase_fetch_row($resultado)){				
					echo"<option value='$fila[0]'>$fila[0]";				
			}
			echo "</select>";			
		?>
	</tr>
	<tr>
		<td><span onmouseover="Tip('Descripcion del Login')" onmouseout="UnTip()">Descripcion del Login</span></td>
		<td><input type="text" onkeypress="return onKeyPressPermiteAlfaNumericos(event)" name="sybmas_desclogin" id="sybmas_desclogin" maxlength="30"></td>
	</tr>	
	<tr>	    
		<td colspan="2"><input type="submit" value="Crear Login">
		<input type="button" value="Cancelar" onclick="history.back()" >
	</tr>
</table>
</form>

</div>
<!-- main --></div>
<!-- scene --> <?php generar_footer();?></div>
</center>
</body>
</html>
